package Library;

/**
 *
 */
public class ErrorCodes
{
    public final static int ERROR_UNKNOWN = -1;
    public final static int ERROR_NOERROR = 0;
    public final static int ERROR_TICKET_EXPIRED = 1;
    public final static int ERROR_TICKET_MISSING = 2;
    public final static int ERROR_ACCOUNT_ALREADY_EXISTS = 3;
    public final static int ERROR_SERVER_ALREADY_EXISTS = 4;
    public final static int ERROR_CANNOT_DELETE_SERVER = 5;
    public final static int ERROR_CANNOT_DELETE_ACCOUNT = 6;
    public final static int ERROR_CANNOT_REGISTER_TICKET = 7;
    public final static int ERROR_GAME_NOT_FOUND = 8;
    public final static int ERROR_GAME_ALREADY_EXISTS = 9;
    public final static int ERROR_SERVER_NOT_FOUND = 10;
    public final static int ERROR_ACCOUNT_NOT_FOUND = 11;
    public final static int ERROR_GAME_FULL = 12;
    public final static int ERROR_GAME_IN_PROGRESS = 13;
    public final static int ERROR_CREATE_GAME_INVALID_RULES = 14;
    public final static int ERROR_REINFORCEMENTS_NOT_ALLOWED = 15;
    public final static int ERROR_ITS_NOT_YOUR_TURN = 16;
    public final static int ERROR_NO_ACTIVE_GAME = 17;
    public final static int ERROR_LAND_IS_NOT_YOURS = 18;
    public final static int ERROR_TOO_MANY_ARMIES = 19;
    public final static int ERROR_LAND_IS_FULL = 20;
    public final static int ERROR_INVALID_LANDID = 21;
    public final static int ERROR_NOT_ENOUGH_ARMIES = 22;
    public final static int ERROR_INVALID_ARMY_COUNT = 23;
    public final static int ERROR_CANNOT_ATTACK_OWN_LANDS = 24;
    public final static int ERROR_LAND_IS_TOO_FAR_AWAY = 25;
    public final static int ERROR_OTHER_PLAYER_NOT_FOUND = 26;
    public final static int ERROR_GAME_ENDED = 27;
    public final static int ERROR_YOU_ALREADY_DECIDED = 28;
    public final static int ERROR_DEFEND_AMOUNT_ALREADY_SET = 29;
    public final static int ERROR_ALREADY_LOGGED_IN = 30;
    public final static int ERROR_INVALID_PASSWORD = 31;
    
    public static String getMessage(int code)
    {
        switch (code)
        {
            case ERROR_NOERROR:
                return "success.";
            case ERROR_TICKET_EXPIRED:
                return "Your Ticket has been expired.";
            case ERROR_TICKET_MISSING:
                return "Your don't have a valid Ticket.";
            case ERROR_ACCOUNT_ALREADY_EXISTS:
                return "Account already exists.";
            case ERROR_SERVER_ALREADY_EXISTS:
                return "Server already exists.";
            case ERROR_CANNOT_DELETE_SERVER:
                return "Cannot delete server.";
            case ERROR_CANNOT_DELETE_ACCOUNT:
                return "Cannot delete account.";
            case ERROR_CANNOT_REGISTER_TICKET:
                return "Cannot register Ticket.";
            case ERROR_GAME_NOT_FOUND:
                return "Game Not Found.";
            case ERROR_GAME_ALREADY_EXISTS:
                return "Game Already Exists.";
            case ERROR_SERVER_NOT_FOUND:
                return "Server not found.";
            case ERROR_ACCOUNT_NOT_FOUND:
                return "Account not found.";
            case ERROR_GAME_FULL:
                return "Game is full.";
            case ERROR_GAME_IN_PROGRESS:
                return "Game Already in Progress.";
	    case ERROR_CREATE_GAME_INVALID_RULES:
		return "Invalid GameRules.";
	    case ERROR_REINFORCEMENTS_NOT_ALLOWED:
		return "Reinforcements not allowed.";
	    case ERROR_ITS_NOT_YOUR_TURN:
		return "It's not your turn.";
	    case ERROR_NO_ACTIVE_GAME:
		return "You are currently not in an active game.";
	    case ERROR_LAND_IS_NOT_YOURS:
		return "This land is not owned by you.";
	    case ERROR_TOO_MANY_ARMIES:
		return "Too many armies to move.";
	    case ERROR_LAND_IS_FULL:
		return "Land is Full.";
	    case ERROR_INVALID_LANDID:
		return "Invalid LandID.";
	    case ERROR_NOT_ENOUGH_ARMIES:
		return "Not Enough Armies for this Action.";
	    case ERROR_INVALID_ARMY_COUNT:
		return "Invalid Army Count.";
	    case ERROR_CANNOT_ATTACK_OWN_LANDS:
		return "You cannot attack your own lands.";
	    case ERROR_LAND_IS_TOO_FAR_AWAY:
		return "These lands are too far away from eachother.";
	    case ERROR_OTHER_PLAYER_NOT_FOUND:
		return "Other Player Not Found.";
	    case ERROR_GAME_ENDED:
		return "Game has already ended.";
	    case ERROR_YOU_ALREADY_DECIDED:
		return "You have already decided for this turn.";
	    case ERROR_DEFEND_AMOUNT_ALREADY_SET:
		return "You have already confirmed your defense strength.";
	    case ERROR_ALREADY_LOGGED_IN:
		return "This account has already logged in.";
	    case ERROR_INVALID_PASSWORD:
		return "You have entered the wrong password.";
            default:
                return "Unknown Error.";
        }
    }
}
